using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace UNGDUNG
{
    public partial class frmBackup : Form
    {
        string strname;
        public frmBackup()
        {
            InitializeComponent();
        }
        public frmBackup(string DatabaseName)
        {
            InitializeComponent();
            strname = DatabaseName;
        }
                          
        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 10000;
            progressBar1.Value = 100;
            clsDatabases cls = new clsDatabases(""); ;
            if (cls.BackupDatabase(strname))
            {
                for (int i = 100; i < progressBar1.Maximum; i++)
                {
                    progressBar1.Value = i;
                }
                MessageBox.Show("Backup sucessful","C# 2005");
                this.Close();
            }
            else
                MessageBox.Show("Backup Fail - " + cls.Error, "C# 2005");
            
        }
         
    }
}